<include file="public/layout" />



<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">

<div id="append_parent"></div>

<div id="ajaxwaitid"></div>

<div class="page">

  <div class="fixed-bar">

    <div class="item-title">

      <div class="subject">

        <h3>评价管理</h3>

        <h5>商品交易评价管理</h5>

      </div>

    </div>

  </div>

  <!-- 操作说明 -->

  <div id="explanation" class="explanation" style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%;">

    <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>

      <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>

      <span title="收起提示" id="explanationZoom" style="display: block;"></span>

    </div>

     <ul>

      <li>用户对购买的商品进行评价</li>

      <li>"显示"栏可控制某条评论是否显示或隐藏</li>

    </ul>

  </div>

  <div class="flexigrid">

    <div class="mDiv">

      <div class="ftitle">

        <h3>商品评价列表</h3>

        <h5></h5>

      </div>

      <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>

	  <form class="navbar-form form-inline"  method="post" name="search-form2" id="search-form2">  

      <div class="sDiv">

        <div class="sDiv2">

          <input type="text" size="30" name="content" class="qsbox" placeholder="评论内容...">

         </div>

         <div class="sDiv2">

          <input type="text" size="30" name="nickname" class="qsbox" placeholder="搜索用户">

         </div>

         <div class="sDiv2">

          <input type="button" onClick="ajax_get_table('search-form2',1)"  class="btn" value="搜索">

        </div>

      </div>

     </form>

    </div>

    <div class="hDiv">

      <div class="hDivBox">

        <table cellspacing="0" cellpadding="0">

          <thead>

	        	<tr>

	              <th class="sign" axis="col0">

	                <div style="width: 24px;"><i class="ico-check"></i></div>

	              </th>

	              <th align="left" abbr="order_sn" axis="col3" class="">

	                <div style="text-align: left; width: 120px;" class="">用户</div>

	              </th> 

	              <th align="left" abbr="consignee" axis="col4" class="">

	                <div style="text-align: left; width: 260px;" class="">评论内容</div>

	              </th>	              

	              <th align="left" abbr="article_show" axis="col5" class="">

	                <div style="text-align: left; width: 260px;" class="">商品</div>

	              </th>

	              <th align="center" abbr="article_time" axis="col6" class="">

	                <div style="text-align: center; width: 80px;" class=""> 显示</div>

	              </th>

	              <th align="center" abbr="article_time" axis="col6" class="">

	                <div style="text-align: center; width: 120px;" class="">评论时间</div>

	              </th>

	              <th align="center" abbr="article_time" axis="col6" class="">

	                <div style="text-align: center; width: 120px;" class=""> ip地址</div>

	              </th>

	              <th align="center" abbr="article_time" axis="col6" class="">

	                <div style="text-align: center; width: 160px;" class=""> 操作</div>

	              </th>

	              <th style="width:100%" axis="col7">

	                <div></div>

	              </th>

	            </tr>

	          </thead>

        </table>

      </div>

    </div>

    <div class="bDiv" style="height: auto;">

      <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">

      </div>

      <div class="iDiv" style="display: none;"></div>

    </div>

    <!--分页位置--> 

   	</div>

</div>

<script type="text/javascript">

	$(document).ready(function(){

	    ajax_get_table('search-form2',1);

	

	 	//点击刷新数据

		$('.fa-refresh').click(function(){

			location.href = location.href;

		});

	 

		$('.ico-check ' , '.hDivBox').click(function(){

			$('tr' ,'.hDivBox').toggleClass('trSelected' , function(index,currentclass){

	    		var hasClass = $(this).hasClass('trSelected');

	    		$('tr' , '#flexigrid').each(function(){

	    			if(hasClass){

	    				$(this).addClass('trSelected');

	    			}else{

	    				$(this).removeClass('trSelected');

	    			}

	    		});  

	    	});

		});

	});

	

	// ajax 抓取页面

	function ajax_get_table(tab,page){

	    cur_page = page; //当前页面 保存为全局变量

	        $.ajax({

	            type : "POST",

	            url:"/index.php/Admin/Comment/ajaxindex/p/"+page,//+tab,

	            data : $('#'+tab).serialize(),// 你的formid

	            success: function(data){

	                $("#flexigrid").html('');

	                $("#flexigrid").append(data);
	                $('[abbr=nickname]').each(function(){
	                	var base = new Base64(); 
	                	var nickname=$(this).children('div').text();
	                	if(nickname==base.encode(base.decode(nickname))){
	                		nickname = base.decode(nickname); 
	                	}
	                	 
	                	$(this).children('div').text(nickname);
	                });

	              

	            	 // 表格行点击选中切换

            	    $('#flexigrid > table>tbody >tr').click(function(){

            		    $(this).toggleClass('trSelected');

            		});

	            	 

	            	 

	            }

	        });

	}

	

	// 删除操作

    function del(id,t) {

		if(confirm('确定要删除吗?'))

			location.href = $(t).data('href');

	}

	

    function op(){

        //获取操作

        var op_type = $('#operate').find('option:selected').val();

        if(op_type == 0){

			layer.msg('请选择操作', {icon: 1,time: 1000});   //alert('请选择操作');

            return;

        }

        //获取选择的id

        //获取选择的id

        var selected_id = new Array();

    	$('.trSelected' , '#flexigrid').each(function(i){

			selected_id[i] = $(this).attr('data-id');

        });

    	console.log(selected_id);

        if(selected_id.length < 1){

			layer.msg('请选择项目', {icon: 1,time: 1000}); //            alert('请选择项目');

            return;

        }

       

        $('#op').find('input[name="selected"]').val(selected_id);

        $('#op').find('input[name="type"]').val(op_type);

        $('#op').submit();

    }


    function Base64() {  
       
        _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";  
       
        // public method for encoding  
        this.encode = function (input) {  
            var output = "";  
            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;  
            var i = 0;  
            input = _utf8_encode(input);  
            while (i < input.length) {  
                chr1 = input.charCodeAt(i++);  
                chr2 = input.charCodeAt(i++);  
                chr3 = input.charCodeAt(i++);  
                enc1 = chr1 >> 2;  
                enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);  
                enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);  
                enc4 = chr3 & 63;  
                if (isNaN(chr2)) {  
                    enc3 = enc4 = 64;  
                } else if (isNaN(chr3)) {  
                    enc4 = 64;  
                }  
                output = output +  
                _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +  
                _keyStr.charAt(enc3) + _keyStr.charAt(enc4);  
            }  
            return output;  
        }  
       
        // public method for decoding  
        this.decode = function (input) {  
            var output = "";  
            var chr1, chr2, chr3;  
            var enc1, enc2, enc3, enc4;  
            var i = 0;  
            input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");  
            while (i < input.length) {  
                enc1 = _keyStr.indexOf(input.charAt(i++));  
                enc2 = _keyStr.indexOf(input.charAt(i++));  
                enc3 = _keyStr.indexOf(input.charAt(i++));  
                enc4 = _keyStr.indexOf(input.charAt(i++));  
                chr1 = (enc1 << 2) | (enc2 >> 4);  
                chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);  
                chr3 = ((enc3 & 3) << 6) | enc4;  
                output = output + String.fromCharCode(chr1);  
                if (enc3 != 64) {  
                    output = output + String.fromCharCode(chr2);  
                }  
                if (enc4 != 64) {  
                    output = output + String.fromCharCode(chr3);  
                }  
            }  
            output = _utf8_decode(output);  
            return output;  
        }  
       
        // private method for UTF-8 encoding  
        _utf8_encode = function (string) {  
            string = string.replace(/\r\n/g,"\n");  
            var utftext = "";  
            for (var n = 0; n < string.length; n++) {  
                var c = string.charCodeAt(n);  
                if (c < 128) {  
                    utftext += String.fromCharCode(c);  
                } else if((c > 127) && (c < 2048)) {  
                    utftext += String.fromCharCode((c >> 6) | 192);  
                    utftext += String.fromCharCode((c & 63) | 128);  
                } else {  
                    utftext += String.fromCharCode((c >> 12) | 224);  
                    utftext += String.fromCharCode(((c >> 6) & 63) | 128);  
                    utftext += String.fromCharCode((c & 63) | 128);  
                }  
       
            }  
            return utftext;  
        }  
       
        // private method for UTF-8 decoding  
        _utf8_decode = function (utftext) {  
            var string = "";  
            var i = 0;  
            var c = c1 = c2 = 0;  
            while ( i < utftext.length ) {  
                c = utftext.charCodeAt(i);  
                if (c < 128) {  
                    string += String.fromCharCode(c);  
                    i++;  
                } else if((c > 191) && (c < 224)) {  
                    c2 = utftext.charCodeAt(i+1);  
                    string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));  
                    i += 2;  
                } else {  
                    c2 = utftext.charCodeAt(i+1);  
                    c3 = utftext.charCodeAt(i+2);  
                    string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));  
                    i += 3;  
                }  
            }  
            return string;  
        }  
    }  
</script>

</body>

</html>